package com.imufe.chemicalenterprisedangerwarning.entity.query;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.imufe.chemicalenterprisedangerwarning.annotation.ExistId;
import com.imufe.chemicalenterprisedangerwarning.mapper.EnterpriseTypeMapper;
import com.imufe.chemicalenterprisedangerwarning.mapper.IndustryMapper;
import com.imufe.chemicalenterprisedangerwarning.mapper.RegionMapper;
import com.imufe.chemicalenterprisedangerwarning.mapper.SafetySupervisionBureauMapper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.math.BigDecimal;

/**
 * @author BaiBan
 * @since 2022/9/24
 */
@ApiModel("企业请求参数")
@Data
public class EnterpriseQuery {
    @ApiModelProperty("企业编号")
    @Null(message = "注册企业时，不能填编号", groups = CreateGroup.class)
    @NotNull(message = "修改企业信息时，编号不能为空", groups = UpdateGroup.class)
    private Long id;

    @ApiModelProperty("企业名称")
    @NotNull(message = "企业名称不能为空", groups = CreateGroup.class)
    private String name;

    @ApiModelProperty("企业简介")
    private String introduction;

    @ApiModelProperty("安监局编号")
    @ExistId(message = "安监局不存在，请选择正确的安监局", groups = CreateGroup.class, value = SafetySupervisionBureauMapper.class)
    private Long safetySupervisionBureauId;

    @ApiModelProperty("注册地址编号")
    @ExistId(message = "注册地址不存在，请输入正确的注册地址", groups = CreateGroup.class, value = RegionMapper.class)
    private Long regionId;

    @ApiModelProperty("统一社会信用代码")
    private String creditCode;

    @ApiModelProperty("行业类别编号")
    @ExistId(message = "行业类别不存在，请输入正确的行业类别", groups = CreateGroup.class, value = IndustryMapper.class)
    private Long industryId;

    @ApiModelProperty("法人代表")
    private String legalPerson;

    @ApiModelProperty("联系方式")
    private String contactWay;

    @ApiModelProperty("传真号码")
    private String faxNo;

    @ApiModelProperty("电话号码")
    private String fixedTelephone;

    @ApiModelProperty("企业类型编号")
    @ExistId(message = "企业类型不存在，请输入正确的企业类型", groups = CreateGroup.class, value = EnterpriseTypeMapper.class)
    private Long enterpriseTypeId;

    @ApiModelProperty("电子邮箱")
    private String eMail;

    @ApiModelProperty("安全生产许可证")
    private String safetyProductionPermit;

    @ApiModelProperty("企业概况")
    private String generalSituation;

    @ApiModelProperty("经度")
    @NotNull(message = "经度不能为空", groups = CreateGroup.class)
    private BigDecimal longitude;

    @ApiModelProperty("维度")
    @NotNull(message = "维度不能为空", groups = CreateGroup.class)
    private BigDecimal dimension;
}